﻿namespace CodeLibrary.Consts
{
    public enum NumberUnit
    {
        Zero, One, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten,
        Eleven, Twelve, Thirteen, Fourteen, Fifteen, Sixteen, Seventeen, Eighteen, Nineteen, 
        Twenty, Thirty, Forty, Fifty, Sixty, Seventy, Eighty, Ninety,
        Hundred, Thousand, Million, Billion
    }

    public enum NumberSign
    {
        Positive, Negative
    }

    public static class NumberFormatter
    {
        public static string FormatUnit(NumberUnit value)
        {
            return units[(int)value];
        }

        public static string FormatSign(NumberSign value)
        {
            return signs[(int)value];
        }

        private static string[] units = new string[] {
            "zero", "one", "two", "three", "four",  "five", 
            "six", "seven", "eight", "nine", "ten",

            "eleven", "twelve", "thirteen", "fourteen", "fifteen", 
            "sixteen", "seventeen", "eighteen", "nineteen",

            "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety",

            "hundred", "thousand ", "million ",  "billion "
        };

        private static string[] signs = new string[] { "positive", "negative" };
    }
}
